<%@ page import="BL.AccessDB"%>
<%@ page import="BL.Eintrag"%>
<%@ page contentType="text/html; charset=ISO-8859-1" language="java"%>
<%
	Eintrag[] erg = BL.AccessDB.getErgebnisliste();
	int xv = 0;
%>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html {
	height: 100%
}

body {
	height: 100%;
	margin: 0px;
	padding: 0px
}

#map_canvas {
	height: 100%
}
</style>
<script type="text/javascript"
	src="https://maps.google.com/maps/api/js?sensor=true">
	
</script>

<script type="text/javascript">
	function initialize() {
		var latlng = new google.maps.LatLng(49.34612355056964, 9.13414478302002);
		var myOptions = {
			zoom : 14,
			center : latlng,
			mapTypeId : google.maps.MapTypeId.ROADMAP
		};
		var map = new google.maps.Map(document.getElementById("map_canvas"),
				myOptions);

		var marker;
		var arraylength =
<%=BL.AccessDB.getArraylength()%>;

		//var contentString = 'Test';
		//var infowindow = new google.maps.InfoWindow({content : contentString});
<%for (int i = 0; i < BL.AccessDB.getArraylength(); i++) {
				out.print("myLatlng = new google.maps.LatLng("
						+ erg[i].getLat() + "," + erg[i].getLang() + ");");
				out.print("marker = new google.maps.Marker({map:map,position : new google.maps.LatLng("
						+ erg[i].getLat()
						+ ","
						+ erg[i].getLang()
						+ "),title : 'Hello World!'});");
				//out.print("google.maps.event.addListener(marker, 'click', function() {infowindow.open(map,marker);});");

			}%>
	// To add the marker to the map, call setMap();

	}
</script>
</head>
<body onload="initialize()">

	<div id="map_canvas" style="width: 50%; height: 50%"></div>
		<jsp:include page="header.jsp" />

</body>
</html>